<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
<meta charset="utf-8" />
<title>Form Elements - Ace Admin</title>

<meta name="description" content="Common form elements and layouts" />
<meta name="viewport"
	content="width=device-width, initial-scale=1.0, maximum-scale=1.0" />

<!-- bootstrap & fontawesome -->
<link rel="stylesheet"
	href="<%=request.getContextPath()%>/ace/assets/css/bootstrap.min.css" />
<link rel="stylesheet"
	href="<%=request.getContextPath()%>/ace/assets/css/font-awesome.min.css" />

<!-- page specific plugin styles -->
<link rel="stylesheet"
	href="<%=request.getContextPath()%>/ace/assets/css/jquery-ui.custom.min.css" />
<link rel="stylesheet"
	href="<%=request.getContextPath()%>/ace/assets/css/chosen.css" />
<link rel="stylesheet"
	href="<%=request.getContextPath()%>/ace/assets/css/datepicker.css" />
<link rel="stylesheet"
	href="<%=request.getContextPath()%>/ace/assets/css/bootstrap-timepicker.css" />
<link rel="stylesheet"
	href="<%=request.getContextPath()%>/ace/assets/css/daterangepicker.css" />
<link rel="stylesheet"
	href="<%=request.getContextPath()%>/ace/assets/css/bootstrap-datetimepicker.css" />
<link rel="stylesheet"
	href="<%=request.getContextPath()%>/ace/assets/css/colorpicker.css" />

<!-- text fonts -->
<link rel="stylesheet"
	href="<%=request.getContextPath()%>/ace/assets/css/ace-fonts.css" />

<!-- ace styles -->
<link rel="stylesheet"
	href="<%=request.getContextPath()%>/ace/assets/css/ace.min.css"
	id="main-ace-style" />

<!--[if lte IE 9]>
			<link rel="stylesheet" href="<%=request.getContextPath()%>/ace/assets/css/ace-part2.min.css" />
		<![endif]-->
<link rel="stylesheet"
	href="<%=request.getContextPath()%>/ace/assets/css/ace-skins.min.css" />
<link rel="stylesheet"
	href="<%=request.getContextPath()%>/ace/assets/css/ace-rtl.min.css" />

<!--[if lte IE 9]>
		  <link rel="stylesheet" href="<%=request.getContextPath()%>/ace/assets/css/ace-ie.min.css" />
		<![endif]-->

<!-- inline styles related to this page -->

<!-- ace settings handler -->
<script
	src="<%=request.getContextPath()%>/ace/assets/js/ace-extra.min.js"></script>

<!-- HTML5shiv and Respond.js for IE8 to support HTML5 elements and media queries -->

<!--[if lte IE 8]>
		<script src="<%=request.getContextPath()%>/ace/assets/js/html5shiv.min.js"></script>
		<script src="<%=request.getContextPath()%>/ace/assets/js/respond.min.js"></script>
		<![endif]-->
		<script src="<%=request.getContextPath()%>/js/jquery.min.js"></script>
		<style type="text/css">
			.point{cursor:pointer;}
		</style>
</head>

<body class="no-skin">
	<div class="breadcrumbs" id="breadcrumbs">

		<ul class="breadcrumb">
			<li><i class="ace-icon fa fa-home home-icon"></i> <a href="#">Home</a>
			</li>

			<li><a href="#">Tables</a></li>
			<li class="active">Simple &amp; Dynamic</li>
		</ul>
		<!-- /.breadcrumb -->

	</div>

	<!-- /section:basics/content.breadcrumbs -->
	<div class="page-content">
		<!-- /section:settings.box -->
		<div class="page-content-area">
			<div class="page-header">
				<h1>
					咨询师审核
				</h1>
			</div>
			<!-- /.page-header -->

			<div class="row">
				<div class="col-xs-12">
					<!-- PAGE CONTENT BEGINS -->
					<form class="form-horizontal">
						<!-- #section:elements.form -->
						<input id="uuid" name="uuid" type="hidden" value="${userCounselorCompany.counselor.uuid}" class="ace" /> <span
															class="lbl"></span>
						<input id="duty" name="duty" type="hidden" >
								<div class="form-group">
									<label class="col-sm-3 control-label no-padding-right"
										for="form-field-1"> 手机号 </label>
		
									<div class="col-sm-9">
										<input type="text" id="form-field-1" value="${userCounselorCompany.user.phone}"
											class="col-xs-10 col-sm-5" readonly="readonly"/>
									</div>
								</div>
								<div class="form-group">
									<label class="col-sm-3 control-label no-padding-right"
										for="form-field-1"> 昵称 </label>
		
									<div class="col-sm-9">
										<input type="text" id="form-field-1" value="${userCounselorCompany.user.realName}"
											class="col-xs-10 col-sm-5" readonly="readonly"/>
									</div>
								</div>
								<div class="form-group">
									<label class="col-sm-3 control-label no-padding-right"
										for="form-field-1"> 真实姓名 </label>
		
									<div class="col-sm-9">
										<input type="text" id="form-field-1" value="${userCounselorCompany.user.userName}"
											class="col-xs-10 col-sm-5" readonly="readonly"/>
									</div>
								</div>
								<div class="form-group">
									<label class="col-sm-3 control-label no-padding-right"
										for="form-field-1"> 审核状态 </label>
		
									<div class="col-sm-9">
										<input type="text" id="form-field-1" value="${userCounselorCompany.counselor.status=='1'?'待审核':userCounselorCompany.counselor.status=='2'?'审核通过':userCounselorCompany.counselor.status=='3'?'审核未通过':'未知'}"
											class="col-xs-10 col-sm-5" readonly="readonly"/>
									</div>
								</div>
								<div class="form-group">
									<label class="col-sm-3 control-label no-padding-right"
										for="form-field-1"> 公司名称 </label>
		
									<div class="col-sm-9">
										<input type="text" id="form-field-1" value="${userCounselorCompany.company.companyName}"
											class="col-xs-10 col-sm-5" readonly="readonly"/>
									</div>
								</div>
								<div class="form-group">
									<label class="col-sm-3 control-label no-padding-right"
										for="form-field-1"> 个人头像 </label>
		
									<div class="col-sm-9">
										<%-- <input type="text" id="form-field-1" value="${counselor.accountantImage}"
											class="col-xs-10 col-sm-5" readonly="readonly"/> --%>
												<img height="200" width="200" class="point"  onclick="javascript:bigimg1(this.src);" alt="${userCounselorCompany.user.headImage}" src="<%=request.getContextPath()%>/getPic/head/${userCounselorCompany.user.headImage}" />
									</div>
								</div>
								<div class="form-group">
									<label class="col-sm-3 control-label no-padding-right"
										for="form-field-1"> 会计师照片 </label>
		
									<div class="col-sm-9">
										<%-- <input type="text" id="form-field-1" value="${counselor.accountantImage}"
											class="col-xs-10 col-sm-5" readonly="readonly"/> --%>
												<c:forEach items="${userCounselorCompany.counselor.accountantImages }" var="accountantImage">
													<img height="200" width="200" class="point" data-target="#myModalimg" onclick="javascript:bigimg1(this.src);" alt="${userCounselorCompany.counselor.accountantImage}" src="<%=request.getContextPath()%>/getPic/cert/${accountantImage}" />
												</c:forEach>
									</div>
								</div>
								<div class="form-group">
									<label class="col-sm-3 control-label no-padding-right"
										for="form-field-1"> 税务师照片 </label>
		
									<div class="col-sm-9">
									<c:forEach items="${userCounselorCompany.counselor.taxImages }" var="taxImage">
										<img height="200" width="200" class="point" onclick="javascript:bigimg1(this.src);" alt="${userCounselorCompany.counselor.accountantImage}" src="<%=request.getContextPath()%>/getPic/cert/${taxImage}" />
									</c:forEach>
									</div>
								</div>
								<div class="form-group">
									<label class="col-sm-3 control-label no-padding-right"
										for="form-field-1"> 律师证照片 </label>
		
									<div class="col-sm-9">
									<c:forEach items="${userCounselorCompany.counselor.lawyerImages }" var="lawyerImage">
										<img height="200" width="200" class="point" onclick="javascript:bigimg1(this.src);" alt="${userCounselorCompany.counselor.accountantImage}" src="<%=request.getContextPath()%>/getPic/cert/${lawyerImage}" />
										</c:forEach>
									</div>
								</div>
								<div class="form-group">
									<label class="col-sm-3 control-label no-padding-right"
										for="form-field-1"> 审核未通过原因 </label>
		
									<div class="col-sm-9">
										<input type="text" id="form-field-1" value="${userCounselorCompany.counselor.aduitReason}"
											class="col-xs-10 col-sm-5" readonly="readonly"/>
									</div>
								</div>
								<div class="form-group">
									<label class="col-sm-3 control-label no-padding-right"
										for="form-field-1"> 申请日期 </label>
		
									<div class="col-sm-9">
										<input type="text" id="form-field-1" value="<fmt:formatDate pattern="yyyy-MM-dd HH:mm"
																value="${userCounselorCompany.counselor.applyDate}" />"
											class="col-xs-10 col-sm-5" readonly="readonly"/>
									</div>
								</div>
								<div class="form-group">
									<label class="col-sm-3 control-label no-padding-right"
										for="form-field-1"> 咨询师级别 </label>
		
									<div class="col-sm-9">
										<%-- <input type="text" id="form-field-1" value="${userCounselorCompany.counselor.counselorLevel}"
											class="col-xs-10 col-sm-5" readonly="readonly"/> --%>
										<c:choose>
											<c:when test="${userCounselorCompany.counselor.status=='2'||userCounselorCompany.counselor.status=='3'}">
												<input type="text" id="form-field-1" value="${userCounselorCompany.level.name}"
												class="col-xs-10 col-sm-5" readonly="readonly"/>
											</c:when>
										 	 <c:otherwise>
													<select class="col-xs-10 col-sm-5" name="counselorLevel" id="level">
														<option  value="0">请选择</option>
														<c:forEach items="${levels }" var="level">
																		<option value="${level.uuid}" <c:if test="${level.uuid==userCounselorCompany.level.uuid}">selected</c:if>>${ level.name}</option>
														</c:forEach>
													</select>
										   </c:otherwise>
										</c:choose>
									</div>
								</div>
								<div class="form-group">
									<label class="col-sm-3 control-label no-padding-right"
										for="form-field-1"> 咨询师职责范围 </label>
										<div class="col-sm-9">
											<c:forEach items="${duties }" var="duty">
												<input type="checkbox" name="duties" readonly="readonly" value="${duty.id }"  />&nbsp;&nbsp;${duty.dutyName }
											</c:forEach>
										</div>
								</div>
								<div class="form-group">
									<label class="col-sm-3 control-label no-padding-right"
										for="form-field-1"> 个人经历 </label>
		
									<div class="col-sm-9">
										<input type="text" id="form-field-1" value="${userCounselorCompany.counselor.experience}"
											class="col-xs-10 col-sm-5" readonly="readonly"/>
									</div>
								</div>
								<div class="form-group">
									<label class="col-sm-3 control-label no-padding-right"
										for="form-field-1"> 擅长业务 </label>
		
									<div class="col-sm-9">
										<textarea rows="2" cols="5" id="form-field-1"
									placeholder="des" name="des" class="col-xs-10 col-sm-5" readonly="readonly">${userCounselorCompany.counselor.adept}</textarea>
<%-- 										<input type="text" id="form-field-1" value="${userCounselorCompany.counselor.adept}" --%>
<!-- 											class="col-xs-10 col-sm-5" readonly="readonly"/> -->
									</div>
								</div>
								<div class="form-group">
									<label class="col-sm-3 control-label no-padding-right"
										for="form-field-1"> 经典案例 </label>
		
									<div class="col-sm-9">
										<input type="text" id="form-field-1" value="${userCounselorCompany.counselor.classicalCase}"
											class="col-xs-10 col-sm-5" readonly="readonly"/>
									</div>
								</div>
								<div class="form-group">
									<label class="col-sm-3 control-label no-padding-right"
										for="form-field-1"> 咨询费用 </label>
		
									<div class="col-sm-9">
										<input type="text" id="form-field-1" value="${userCounselorCompany.counselor.consultMoney}"
											class="col-xs-10 col-sm-5" readonly="readonly"/>
									</div>
								</div>
								<div class="form-group">
									<label class="col-sm-3 control-label no-padding-right"
										for="form-field-1"> 经典案例照片 </label>
		
									<div class="col-sm-9">
									<c:forEach items="${userCounselorCompany.counselor.caseImagesList }" var="caseImages">
										<img height="200" width="200" class="point" onclick="javascript:bigimg1(this.src);" alt="${caseImages}" src="<%=request.getContextPath()%>/getPic/cert/${caseImages}" />
										</c:forEach>
									</div>
								</div>
						<div class="clearfix form-actions">
							<div class="col-md-offset-3 pull-left col-md-1">
								<input type="button" class="btn btn-info" type="button" onclick="goOperate('pass')"  value="通过" />
							</div>
							<div class="col-md-offset-1 pull-left col-md-1">
								<input type="button" class="btn btn-info" type="button" onclick="return goOperate('nopass');"  value="不通过" />
							</div>
							<div class="col-md-offset-1 pull-left col-md-1">
								<input type="button" class="btn btn-info" type="button" onclick="location.href='<%=request.getContextPath()%>/counselor/list.do'" value="返回" />
							</div>
						</div>
					</form>
					<div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
											<jsp:include page="modal.jsp"></jsp:include>
										</div>
					<div class="modal fade" id="myModalimg" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
											<jsp:include page="modalbigimg.jsp"></jsp:include>
										</div>
					<!-- PAGE CONTENT ENDS -->
				</div>
				<!-- /.col -->
			</div>
			<!-- /.row -->
		</div>
		<!-- /.page-content-area -->
	</div>
	<!-- /.page-content -->
</body>

<!-- basic scripts -->

<!--[if !IE]> -->
<script type="text/javascript">
	window.jQuery
			|| document
					.write("<script src='<%=request.getContextPath()%>/ace/assets/js/jquery.min.js'>"
							+ "<"+"/script>");
</script>

<!-- <![endif]-->

<!--[if IE]>
<script type="text/javascript">
 window.jQuery || document.write("<script src='<%=request.getContextPath()%>/ace/assets/js/jquery1x.min.js'>"+"<"+"/script>");
</script>
<![endif]-->
<script type="text/javascript">
	if ('ontouchstart' in document.documentElement)
		document.write("<script src='<%=request.getContextPath()%>/ace/assets/js/jquery.mobile.custom.min.js'>"+ "<"+"/script>");
</script>

<script
	src="<%=request.getContextPath()%>/ace/assets/js/bootstrap.min.js"></script>
<script type="text/javascript">
function goOperate(operate){
	if(operate=="pass"){
		obj = document.getElementsByName("duties");
	    check_val = [];
	    for(k in obj){
	        if(obj[k].checked)
	            check_val.push(obj[k].value);
	    }
	    if(check_val.length==0){
	    	alert("请选择咨询师职责");
	    	return false;
	    }
	    $("#duty").val(check_val);
		var status = ${userCounselorCompany.counselor.status};
		/*if(status =="2"){
			alert("该用户已通过审核");
			return false;
		}
		 else if(status=='3'){
   		 alert("该用户已经审核过,未通过");
         return false;
	} */
		var val=$("#uuid").val();
		var id = $("#level").val();
		var duty =  check_val.join();
		if(id=='0'){
			alert("请选择咨询师级别");
			return false;
		}
        	 $.ajax({
                 type: "POST",
                 url: "<%=request.getContextPath()%>/counselor/pass.do",
                 data: {uuid:val,id:id,duty:duty},
                 dataType: "json",
                 success: function(data){
                                alert(data.info);
                	 		if(data.status=='y'){
                	 			window.location.href="<%=request.getContextPath()%>/counselor/list?status=1";
                	 		}
                          }
             });
	}
	if(operate=="nopass"){
		var status = ${userCounselorCompany.counselor.status};
		/* if(status =="2"){
			alert("该用户已通过审核");
			return false;
		}else  */
	if(status=='3'){
		alert("该用户已经审核过,未通过");
	     return false;
	}
		var val=$("#uuid").val();
        	$('#myModal').modal('show');//弹出摸态框
        	$("#counsolerid").val(val);
        	/* var status = $("#uuid:checked").siblings("input[name='status']").val();
        	if(status==0){
        		 alert("该用户尚未认证");
        		 $("input[data-toggle='modal']").removeAttr("data-target");
                 return false;
        	}else if(status=='3'){
        		 alert("该用户已经审核过,未通过");
        		 $("input[data-toggle='modal']").removeAttr("data-target");
                 return false;
        	}else if(status=='2'){
        		 alert("该用户已经审核通过");
        		 $("input[data-toggle='modal']").removeAttr("data-target");
                 return false;
        	}else{
            	$("input[data-toggle='modal']").attr("data-target","#myModal");
        	} */
	}
	
}

</script>
<script type="text/javascript">
function bigimg1(src){
	$("#bigimg").attr("src",src)
	$('#myModalimg').modal('show');
}
</script>
<!-- the following scripts are used in demo only for onpage help and you don't need them -->
<link rel="stylesheet"
	href="<%=request.getContextPath()%>/ace/assets/css/ace.onpage-help.css" />
<link rel="stylesheet"
	href="<%=request.getContextPath()%>/ace/docs/assets/js/themes/sunburst.css" />

</html>
